home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-04-13 | 1.2 KB | 49 lines | [TEXT/GEOL] |
- Item 5647838 12-April-89 11:20
-
- From: FRIEDRICH1 Friedrich, Steve
-
- To: BEL0076 Hermes Systems SA
-
- cc: MACAPP.TECH$ MACAPP Tech
-
- Sub: Re: Dangerous lock in 2.0B7
-
- The locking mechanism has been changed to:
-
- ---------------------------------------------
- FUNCTION TObject.Lock(lockIt: BOOLEAN): BOOLEAN;
- {$Push} {$IFC qTrace} {$D+} {$ENDC}
- {$W+}
- {$R-}
- {$OV-}
- {$S MAMain}
- { Locks down or unlocks an object. Returns old state.
- Since objects can float around in memory some occasions may arise where they
- need to be locked
- down (like being referenced by a completion routine.) _PLEASE_ use this
- sparingly and don't just
- go locking stuff down willy-nilly just because you might be afraid of handles.
- }
- VAR
- wasLocked: Boolean;
-
- BEGIN
- wasLocked := IsHandleLocked(self);
- Lock := wasLocked;
- if wasLocked <> lockIt then
- IF lockIt THEN
- HLock(Handle(self))
- ELSE
- HUnLock(Handle(self))
- END;
- {$Pop}
- ----------------------------------------------
- in the next APDA version of MacApp.
-
- We will probably just programbreak if you try to free a locked object.
- Any comments.
-
- Regards,
- Steve Friedrich
-
-